//
//  DYBranchListCell.m
//  kafuMerchant
//
//  Created by 帝云科技 on 2018/9/18.
//  Copyright © 2018年 帝云科技. All rights reserved.
//

#import "DYBranchListCell.h"

@interface DYBranchListCell ()

@property (nonatomic,strong)UIImageView *bgimageView;
@property (nonatomic,strong)UIImageView *shopImageView;
@property (nonatomic,strong)UILabel *nameLabel;
@property (nonatomic,strong)UILabel *shopManagerLabel;
@property (nonatomic,strong)UILabel *shopManagerPhoneLabel;

@end

@implementation DYBranchListCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

-(void)dy_initUI
{
    [super dy_initUI];
    
    
    self.sideMargin=BILIWIDTH(10);
    [self xhq_noneSelectionStyle];
    
    self.bgimageView = ({
        UIImageView *imageView=[Utils imageViewWithImage:IMG(@"shoplogo_shadow")];
        imageView;
    });
    
    self.shopImageView = ({
        UIImageView *imageView=[Utils imageViewWithImage:IMG(@"logo_dianpu")];
        imageView.contentMode=UIViewContentModeScaleAspectFill;
        imageView;
    });
    
    self.nameLabel = ({
        UILabel *label=[Utils labelWithTitleBlodFontSize:15 textColor:[UIColor xhq_aTitle] alignment:0];
        label;
     });
    
    self.shopManagerLabel = ({
        UILabel *label=[Utils labelWithTitleFontSize:12 textColor:[UIColor xhq_content] alignment:0];
        label;
    });
    
    self.shopManagerPhoneLabel = ({
        UILabel *label=[Utils labelWithTitleFontSize:12 textColor:[UIColor xhq_content] alignment:2];
        label;
    });
    
    [self addSubview:self.bgimageView];
    [self.bgimageView addSubview:self.shopImageView];
    
    [self addSubview:self.nameLabel];
    [self addSubview:self.shopManagerLabel];
    [self addSubview:self.shopManagerPhoneLabel];
    
    [self.bgimageView makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(BILIWIDTH(10));
        make.top.equalTo(BILIHEIGHT(10));
        make.width.height.equalTo(BILIHEIGHT(58));
    }];
    
    [self.shopImageView makeConstraints:^(MASConstraintMaker *make) {
        make.center.equalTo(self.bgimageView);
        make.width.height.equalTo(BILIHEIGHT(50));
    }];
    
    [self.nameLabel makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.bgimageView.right).offset(BILIWIDTH(7));
        make.top.equalTo(self.bgimageView).offset(BILIHEIGHT(9));
        make.right.equalTo(BILIWIDTH(-10));
    }];
    
    [self.shopManagerLabel makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.nameLabel);
        make.bottom.equalTo(BILIHEIGHT(-19));
        make.width.equalTo(BILIWIDTH(140));
    }];
    
    [self.shopManagerPhoneLabel makeConstraints:^(MASConstraintMaker *make) {
        make.right.equalTo(BILIWIDTH(-10));
        make.centerY.equalTo(self.shopManagerLabel);
    }];
    
    
    self.nameLabel.text=@"家乐福";
    self.shopManagerLabel.text=@"店长：张红";
    self.shopManagerPhoneLabel.text=@"店长电话：1281839123";
    
    
    
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
